<!--#INCLUDE FILE="conn.asp"-->
<!-- #include file="function.asp" -->
<!-- #include file="comsub.asp" -->
<script src=inc/js2.js></script>

<%
if Request("menu")="replysend" then
       call replysend(request("incept"))
end if
if Request("menu")="send" then
       call send
end if
if Request("menu")="allsend" then
       call allsend
end if
if session("tslt_username")="" then
%>
       <center><br><br><font size=4 face= color=#000070>ȵ¼</font>
       <form name="form1" method="post" action="">
                 <input type="submit" name="Submit" value="ر" >
       </form>
<%   
       if trim(request.form("Submit")) = "ر" then
               response.Write("<script language=JavaScript>self.close()</script>")
       End if
else
       if Request("menu")="forummanageuser" then
              call forummanageuser
       end if
end if
if Request("menu")="look" then
       call  newmessagecount
end if

Call conn_Nothing()

function MYNoteByte()
       dim rs
       dim sql
	   Dim NoteByte2
       sql="select NoteByte from MYScoreRoom"
       set rs=conn.execute(sql)
             NoteByte2=rs("NoteByte") 
       rs.close
       set rs=nothing
       MYNoteByte=NoteByte2
end function

sub replysend(aaa)
%>
      <title>ظ - </title>
      <style>
                .bt {BORDER-RIGHT: 1px; BORDER-TOP: 1px; FONT-SIZE: 9pt; BORDER-LEFT: 1px; BORDER-BOTTOM: 1px;}
      </style>
      <body topmargin=0>
      <SCRIPT language=JavaScript>
                 function check(theForm) {
                       if (theForm.content1.value.length > <%=MYNoteByte%>){
                              alert("ԲĶŲܳ <%=MYNoteByte%> ֽڣ");
                              return false;
                       }
                 }
                 function presskey(eventobject){if(event.ctrlKey && window.event.keyCode==13){this.document.form.submit();}}
                function OnAddContact() {if(form.content1.value==""){form.okButton.disabled=true}else{form.okButton.disabled=false}}
       </SCRIPT>
       <form name=form action="sitenote.asp" method="post">
       <input type="hidden" name="menu" value="addreplypost">
       <TABLE WIDTH=300 BORDER=0 CELLSPACING=0 CELLPADDING=0>
                <TR><TD><span style="font-size:20">ߣ</span><input readOnly type="text" name="text1" size="10" value=<%=aaa%>></TD></TR>
                <TR><TD VALIGN=top ALIGN=conter colspan="2" bgcolor="F8F8F8">
                                 <textarea name="content1" cols="30" rows="8" onkeydown=presskey() onKeyUp=OnAddContact() onMouseOut=OnAddContact()></textarea>
                                 <span style="font-size:12px"><a class=a1 href="UBB/UBBHtml.htm" target="_blank">֧UBB룩</span>
                         </TD>
                </TR>
<%
               If VCYes() Then
                   Response.Write "<TR><TD>"
                   Response.Write "֤&nbsp;<input type='text' name='chknum' size='8'>&nbsp;&nbsp;"
                   Call ImgVCShow()
                   Response.Write "</TD></TR>"
               End If
%>
       </TABLE>
       <TABLE WIDTH=300 BORDER=0 CELLSPACING=0 CELLPADDING=0 height="30">
                 <tr >
                         <TD><input type="submit" value="ظ" name=okButton onclick="return check(this.form);" disabled></td>
                         <TD><input type="reset" value="ȡظ" OnClick="self.close();"></td>
                 </TR>
        </TABLE>
        </form>
        </body>
<%
end sub

sub send()
%>
       <title>Ͷ - </title>
       <body topmargin=0>
       <SCRIPT language=JavaScript>
                function check(theForm) {
                        if (theForm.text2.value==""){
                                 alert("ԲûΪգ");
                                 return false;
                        }
                       if (theForm.content2.value.length > <%=MYNoteByte%>){
                                 alert("ԲĶŲܳ <%=MYNoteByte%> ֽڣ");
                                 return false;
                        }
                 }
                function presskey(eventobject){if(event.ctrlKey && window.event.keyCode==13){this.document.form.submit();}}
                function OnAddContact() {if(form.content2.value==""){form.okButton.disabled=true}else{form.okButton.disabled=false}}
       </SCRIPT>
       <form name=form action="sitenote.asp" method="post">
       <input type="hidden" name="menu" value="addsend">
       <TABLE WIDTH=300 BORDER=0 CELLSPACING=0 CELLPADDING=0>
                 <TR>
                          <TD><span style="font-size:20">û</span><input type="text" name="text2" size="10"></TD>
                 </TR>
                 <TR><TD VALIGN=top ALIGN=conter colspan="2" bgcolor="F8F8F8">
                                <textarea name="content2" cols="30" rows="8" onkeydown=presskey() onKeyUp=OnAddContact() onMouseOut=OnAddContact()></textarea>
                                <span style="font-size:12px"><a class=a1 href="UBB/UBBHtml.htm" target="_blank">֧UBB룩</span>
                        </TD>
                 </TR>
<%
               If VCYes() Then
                   Response.Write "<TR><TD>"
                   Response.Write "֤&nbsp;<input type='text' name='chknum' size='8'>&nbsp;&nbsp;"
                   Call ImgVCShow()
                   Response.Write "</TD></TR>"
               End If
%>
       </TABLE>
       <TABLE WIDTH=300 BORDER=0 CELLSPACING=0 CELLPADDING=0 height="30">
                 <tr >
                         <TD><input type="submit" value="Ͷ" name=okButton onclick="return check(this.form);" disabled></td>
                         <TD><input type="reset" value="ȡ" OnClick="self.close();"></td>
                 </TR>
        </TABLE>
        </form>
        </body>
<%
end sub

sub allsend()
%>
      <title>Ⱥ - </title>
      <body topmargin=0>
      <SCRIPT language=JavaScript>
               function check(theForm) {
                      if (theForm.content3.value.length > <%=MYNoteByte%>){
                              alert("ԲĶŲܳ <%=MYNoteByte%> ֽڣ");
                              return false;
                       }
                 }
                 function presskey(eventobject){if(event.ctrlKey && window.event.keyCode==13){this.document.form.submit();}}
                 function OnAddContact() {if(form.content3.value==""){form.okButton.disabled=true}else{form.okButton.disabled=false}}
      </SCRIPT>
      <form name=form action="sitenote.asp" method="post">
      <input type="hidden" name="menu" value="allsend">
      <TABLE WIDTH=300 BORDER=0 CELLSPACING=0 CELLPADDING=0>
               <TR><TD><span style="font-size:20">û</span><input readOnly type="text" name="text3" size="10" value=ȫû></TD>
               </TR>
               <TR><TD VALIGN=top ALIGN=conter colspan="2" bgcolor="F8F8F8">
                                <textarea name="content3" cols="30" rows="8" onkeydown=presskey() onKeyUp=OnAddContact() onMouseOut=OnAddContact()></textarea>
                                <span style="font-size:12px"><a class=a1 href="UBB/UBBHtml.htm" target="_blank">֧UBB룩</span>
                        </TD>
               </TR>
       </TABLE>
       <TABLE WIDTH=300 BORDER=0 CELLSPACING=0 CELLPADDING=0 height="30">
                <tr >
                         <TD><input type="submit" value="Ⱥ" name=okButton onclick="return check(this.form);" disabled></td>
                         <TD><input type="reset" value="ȡ" OnClick="self.close();"></td>
               </TR>
        </TABLE>
        </form>
        </body>
<%
end sub

sub forummanageuser()
         dim rs,sql
         sql="select username from ts_userinfo where bclass=1 or bclass=2"
         set rs=server.createobject("adodb.recordset")
         rs.open sql,conn,1,1
                 if rs.bof or rs.eof then
%>
                          <script language=JavaScript>
                                   alert ("Աʱڣرձ  !");
                                   close();
                          </script>
<%
                        exit sub
                 end if
%>
               <title> - </title>
               <body topmargin=0>
               <SCRIPT language=JavaScript>
                      function check(theForm) {
                            if (theForm.content4.value.length > <%=MYNoteByte%>){
                                   alert("ԲĶŲܳ <%=MYNoteByte%> ַ");
                                    return false;
                            }
                      }
                      function presskey(eventobject){if(event.ctrlKey && window.event.keyCode==13){this.document.form.submit();}}
                      function OnAddContact() {if(form.content4.value==""){form.okButton.disabled=true}else{form.okButton.disabled=false}}
                </SCRIPT>
                <form name=form action="sitenote.asp" method="post">
                <input type="hidden" name="menu" value="forummanageuser">
                <TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0>
                     <TR><TD>
                          <span style="font-size:20">Ա</span>
                          <select name="text4" style="width:100px;">
                                  <option value=""></option>
<%
                                  for i=0 to rs.recordcount
                                         response.write"<option>"
                                         Response.Write rs("username")
                                         response.write"</option>"
                                         rs.MoveNext
                                         If rs.EOF Then Exit For
                                  next
%>   
                         </select>
                         </TD>
                     </TR>
                     <TR>
                          <TD VALIGN=top ALIGN=right colspan="2" bgcolor="F8F8F8">
<%
                                   dim s2,sql2,sc2
                                   sql2="select sitenotecotent from option1"
                                   set rs2=server.createobject("adodb.recordset")
                                   rs2.open sql2,conn,1,1
                                            if not rs2.bof or rs2.eof then
                                                    sc2=rs2("sitenotecotent")
                                            end if
                                   rs2.close  
                                   Set rs2 = Nothing
%>
                                  <textarea name="content4" cols="30" rows="8" onkeydown=presskey() onKeyUp=OnAddContact() onMouseOut=OnAddContact()><%=sc2%></textarea>
                                  <span style="font-size:12px"><a class=a1 href="UBB/UBBHtml.htm" target="_blank">֧UBB룩</span>	
                         </TD>
                     </TR>
              </TABLE>
              <%if (session("tslt_useridentity")=1 or session("tslt_useridentity")=2) then%>
                      <TABLE WIDTH=300 BORDER=0 CELLSPACING=0 CELLPADDING=0 height="30">
                             <TR>
                                      <TD><span style="font-size:20">Աֶ:</span>
                                      <textarea name="content44" cols="30" rows="1"><%=sc2%></textarea></TD>
                             </TR>
                      </TABLE>
              <%end if%>
              <TABLE WIDTH=300 BORDER=0 CELLSPACING=0 CELLPADDING=0 height="30">
                       <tr >
                              <TD><input type="submit" value="ѶϢ" name=okButton onclick="return check(this.form);" disabled></td>
                              <TD><input type="reset" value="ȡ" OnClick="self.close();"></td>
                       </TR>
              </TABLE>
              </form>
              </body>
<%
         rs.close
         Set rs = Nothing
end sub

sub newmessagecount()
       dim rs,sql,newmessage2
       sql ="select newmessage from ts_userinfo where username='"&session("tslt_username")&"'"
       set rs=server.createobject("adodb.recordset")
       rs.open sql,conn,1,2
               for i=0 to rs.recordcount
                    newmessage2=rs("newmessage")
                    rs.movenext
                    If RS.EOF Then Exit For
               next
       rs.close
       set rs=nothing
       dim rs2,sql2
       sql2 ="select * from sitenote where incept='"&session("tslt_username")&"' order by logintime Desc"
       set rs2=server.createobject("adodb.recordset")
       rs2.open sql2,conn,1,2
              for j=1 to newmessage2
                   dim opyrs,copysql
                   copysql ="select * from sitenotecopy"
                   set copyrs=server.createobject("adodb.recordset")
                   copyrs.open copysql,conn,1,2
                                copyrs.addnew array("author","incept","content","logintime"),array(rs2("author"),rs2("incept"),rs2("content"),rs2("logintime"))
                                copyrs.update
                   copyrs.close
                   set copyrs=nothing
                   rs2.MoveNext
                   If rs2.EOF Then Exit For
             next
        rs2.close
        set rs2=nothing
        call look
end sub

sub look()
       dim page,rs
       conn.execute("update ts_userinfo set newmessage=0 where username='"&session("tslt_username")&"'")
       page=Request("page")
       if page<1 then
              disabled="disabled=true"
              page=0
       end if
       count=conn.execute("Select count(id) from sitenotecopy where incept='"&session("tslt_username")&"'")(0)
       sql="select author,content from sitenotecopy where incept='"&session("tslt_username")&"' order by logintime Desc"
       Set Rs=Conn.Execute(sql)
              if Count-page<2 then disabled2="disabled=true"
              if rs.eof then error("ûжţ")
              RS.Move page
%>
                     <title>鿴</title>
                     <body topmargin=0>
                     <style>
                                 .bt {BORDER-RIGHT: 1px; BORDER-TOP: 1px; FONT-SIZE: 9pt; BORDER-LEFT: 1px; BORDER-BOTTOM: 1px;}
                      </style>
                      <form name=form action="sitenote.asp" method="post">
                      <input type="hidden" name="menu" value="addpost">
                      <TABLE CELLSPACING=0 CELLPADDING=0 border=0 WIDTH=300>
                               <TR>
                                        <TD width=340>
                                                <span style="font-size:20">дߣ</span><input readOnly type="text" name="text5" size="10" value=<%=rs("author")%>>
                                                <input type="reset" value="رմ" OnClick="self.close();">
                                        </TD>
                               </TR>
                               <TR>
                                        <TD VALIGN=top ALIGN=conter colspan="2" bgcolor="F8F8F8" style="word-break:break-all">
                                                 <!--   <textarea readOnly name="content5" cols="26" rows="7"><%=rs("content")%></textarea></TD>  -->
                                                 <%=rs("content")%>
                                        </TD>
                                </TR>
                     </TABLE>
                     <TABLE CELLSPACING=0 CELLPADDING=0 height="30">
                                <tr >
                                        <%' עһеַ friend.asp?menu=replysend& sitenote.aspлظͼƬӵַͬ%>
                                        <TD><input type="button" value="ظ" onclick=javascript:open('friend.asp?menu=replysend&incept=<%=rs("author")%>','_top','width=320,height=170')></td>
                                        <TD><input type="button" value="һ" <%=disabled%> onclick=javascript:open('friend.asp?menu=look&page=<%=page-1%>','_top','')></td>
                                        <TD><input type="button" value="һ" <%=disabled2%> onclick=javascript:open('friend.asp?menu=look&page=<%=page+1%>','_top','')></td>
                                </TR>
                     </TABLE>
                     </form>
                     </body>
<%
end sub
%>
